import time

import requests

from requests.auth import HTTPBasicAuth
base_url = "http://139.217.237.110:8080/api/v3/mqtt/publish/"
auth = HTTPBasicAuth('7c804529779d','MjkwNzM0NTI4NDE1MjU1MDgyMjEzMTkxNTE2OTMzOTgwMTG')
res = requests.post(base_url,json={
  "topic": "control",
  "payload": "hello world to every body",
  "qos": 1,
  "retain": False,
  "client_id": "yk123"
},auth=auth).json()
print(res)
url = "http://139.217.237.110:8080/api/v3/auth_username"
res = requests.get(url,auth=auth,json={'username': "123456", "password": "123456"}).json()
print(res)
